home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-comments-popup.php < prev    next >
Encoding:
PHP Script  |  2004-04-21  |  5.0 KB  |  115 lines

  1. <?php 
  2. /* Don't remove these lines. */
  3. $blog = 1;
  4. require ('wp-blog-header.php');
  5. add_filter('comment_text', 'popuplinks');
  6. foreach ($posts as $post) { start_wp();
  7. ?>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11.      <title><?php echo get_settings('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?></title>
  12.  
  13.     <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
  14.     <style type="text/css" media="screen">
  15.         @import url( wp-layout.css );
  16.         body { margin: 3px; }
  17.     </style>
  18.  
  19. </head>
  20. <body id="commentspopup">
  21.  
  22. <h1 id="header"><a href="" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
  23.  
  24. <h2 id="comments"><?php _e("Comments"); ?></h2>
  25.  
  26. <p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>
  27.  
  28. <?php if ('open' == $post->ping_status) { ?>
  29. <p><?php _e("The <acronym title=\"Uniform Resource Identifier\">URI</acronym> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
  30. <?php } ?>
  31.  
  32. <?php
  33. // this line is WordPress' motor, do not delete it.
  34. $comment_author = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : '';
  35. $comment_author_email = (isset($_COOKIE['comment_author_email_'.$cookiehash])) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : '';
  36. $comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : '';
  37. $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
  38. $commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id");
  39. if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'.$cookiehash] != $commentstatus->post_password) {  // and it doesn't match the cookie
  40.     echo(get_the_password_form());
  41. } else { ?>
  42.  
  43. <?php if ($comments) { ?>
  44. <ol id="commentlist">
  45. <?php foreach ($comments as $comment) { ?>
  46.     <li id="comment-<?php comment_ID() ?>">
  47.     <?php comment_text() ?>
  48.     <p><cite><?php comment_type(); ?> <?php _e("by"); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
  49.     </li>
  50.  
  51. <?php } // end for each comment ?>
  52. </ol>
  53. <?php } else { // this is displayed if there are no comments so far ?>
  54.     <p><?php _e("No comments yet."); ?></p>
  55. <?php } ?>
  56.  
  57. <?php if ('open' == $commentstatus->comment_status) { ?>
  58. <h2><?php _e("Leave a comment"); ?></h2>
  59. <p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p>
  60.  
  61. <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  62.     <p>
  63.       <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
  64.        <label for="author"><?php _e("Name"); ?></label>
  65.     <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  66.     <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" />
  67.     </p>
  68.  
  69.     <p>
  70.       <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
  71.        <label for="email"><?php _e("E-mail"); ?></label>
  72.     </p>
  73.  
  74.     <p>
  75.       <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
  76.        <label for="url"><?php _e("<acronym title=\"Uniform Resource Identifier\">URI</acronym>"); ?></label>
  77.     </p>
  78.  
  79.     <p>
  80.       <label for="comment"><?php _e("Your Comment"); ?></label>
  81.     <br />
  82.       <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
  83.     </p>
  84.  
  85.     <p>
  86.       <input name="submit" type="submit" tabindex="5" value="<?php _e("Say It!"); ?>" />
  87.     </p>
  88. </form>
  89. <?php } else { // comments are closed ?>
  90. <p><?php _e("Sorry, the comment form is closed at this time."); ?></p>
  91. <?php }
  92. } // end password check
  93. ?>
  94.  
  95. <div><strong><a href="javascript:window.close()"><?php _e("Close this window."); ?></a></strong></div>
  96.  
  97. <?php // if you delete this the sky will fall on your head
  98. }
  99. ?>
  100.  
  101. <!-- // this is just the end of the motor - don't touch that line either :) -->
  102. <?php //} ?> 
  103. <p class="credit"><?php timer_stop(1); ?> <?php echo sprintf(__("<cite>Powered by <a href=\"http://wordpress.org\" title=\"%s\"><strong>Wordpress</strong></a></cite>"),__("Powered by WordPress; state-of-the-art semantic personal publishing platform.")); ?></p>
  104. <?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
  105. <script type="text/javascript">
  106. <!--
  107. document.onkeypress = function esc(e) {    
  108.     if(typeof(e) == "undefined") { e=event; }
  109.     if (e.keyCode == 27) { self.close(); }
  110. }
  111. // -->
  112. </script>
  113. </body>
  114. </html>
  115.